package com.example;

import java.util.List;
import java.util.Scanner;

public class Syetem {
	//请补全处理订单的函数
    public void  manageOrder(List<Order> dishes,int u,int orderId){
        //要求1：一旦订单里有一个菜品的原料不足以烹饪，就输出“取消订单”，否则输出所有菜品的烹饪方法，最后再输出该订单的编号，编号从1开始递增。
        
            if (dishes.get(orderId-1).check()== false){
                  System.out.println("取消订单");
                  System.out.println("该订单编号为"+(u));
            }else  {
                System.out.println("烹饪方法：" );
                dishes.get(orderId-1).cook();
                System.out.println("该订单编号为"+(u));
            }
            
            
        }
       public <T> void theCustommer(T t,int orderId,WechatCustomer w1){
          if (t instanceof TableCustomer) {
              System.out.println("该订单来自桌台顾客,订单编号为"+orderId);
              System.out.println("送餐到对应餐桌");
          }else if(t instanceof WechatCustomer){
                if(w1.isTakeout()==false){
                    System.out.println("该订单来自微信堂食顾客,订单编号为"+orderId);
                    System.out.println("送餐到对应餐桌");
                }else if(w1.isTakeout()==true){
                    System.out.println("请输入该客户地址");
                    Scanner addr = new Scanner(System.in);
                    w1.setAddress(addr.nextLine());
                    System.out.println("该订单来自微信外卖顾客,订单编号为"+orderId);
                    System.out.println("送餐到"+w1.getAddress());

                }
          }
       } 
    }

    

